package com.example.teach.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.teach.entity.Major;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface MajorMapper extends BaseMapper<Major> {
    @Update("update major set major_name=#{majorName} where id=#{majorId}")
    void updateById(Integer majorId, String majorName);

    @Update("update major set status=1 where id=#{id}")
    void updateStatus(Integer id);

    @Update("update major set status=0 where id=#{majorId}")
    void updateStatusToZero(Integer majorId);
}
